<?xml version="1.0" encoding="UTF-8"?>
<!-- 
	old version imports, repalce with "xmlns:uml" and "xsi:schemaLocation" - RSingh 04/26/2010
	xmlns:Standard="http://www.eclipse.org/uml2/schemas/Standard/1" 
	xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" 
 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" 
	xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" 
	xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1 http://www.eclipse.org/uml2/2.1.0/UML" 
	xmlns:servU="xalan://gov.dhs.cis.soa.xslt.ServicesUtils" 
	xmlns:servO="xalan://gov.dhs.cis.soa.data.Service" 
	extension-element-prefixes="servU servO" >
	
	<xsl:output method="text"/>
	
	<xsl:param name="DELIM">|</xsl:param>
	<xsl:param name="NEWLN">&#10;</xsl:param>
	<xsl:param name="SERVOBJ" select="servO:new()"/>
	<xsl:template match="uml:Model">
	<!-- 
		<xsl:text>Unique Service Name[DIM]Service Description[DIM]Stereotype[DIM]Mgmt Function[DIM]Release[DIM]IOE Maturity[DIM]Invokes Application[DIM]Invokes External System[DIM]Invokes Other Service[DIM]L2 Business Process Name[DIM]L3 Business Process Name[DIM]SD ID#[DIM]Agent[DIM]Exposure[DIM]Realization[DIM]Integration - Interface Hosting Config[DIM]Integration - ESB Managed Endpoint Container[DIM]Design Aspects[DIM]Estimating Component ID</xsl:text>
	 -->
		<xsl:for-each select="packagedElement[@name='007_Services']">
			<xsl:for-each select="packagedElement[@xmi:type='uml:Class']">
 	   			<xsl:value-of select="servU:initialize($SERVOBJ)"/>
				
				<xsl:variable name="servUMId" select="@xmi:id"/>
				
 	   			<xsl:value-of select="servU:parseName($SERVOBJ, string(@name))"/>
 	   			<xsl:value-of select="servU:parseStereoType($SERVOBJ, string(eAnnotations/details/@key))"/>

 	   			<xsl:value-of select="servU:parseDescription($SERVOBJ, string(ownedComment/body), string($DELIM))"></xsl:value-of>
				<xsl:for-each select="ownedAttribute">
	 	   			<xsl:value-of select="servU:parseAttribute($SERVOBJ, string(@name))"/>
   				</xsl:for-each>
   				<!--
				<xsl:for-each select="ownedOperation">
	 	   			<xsl:value-of select="servU:parseOperation($SERVOBJ, string(@name))"/>
   				</xsl:for-each>
			 	-->
   				<!--  Select all associations -->
				<xsl:for-each select="//packagedElement[@xmi:type='uml:Association']">
					<xsl:if test="contains(@xmi:id, $servUMId)">
	 	   				<xsl:value-of select="servU:parseAssociation($SERVOBJ, string(@xmi:id))"/>
	 	   			</xsl:if>
   				</xsl:for-each>
				<xsl:for-each select="//packagedElement[(@client=$servUMId) and (@xmi:type='uml:Dependency')]">
					<xsl:variable name="depname" select="@name"/>
					<xsl:variable name="supplierid" select="@supplier"/>
					<xsl:for-each  select="//packagedElement[@xmi:id=$supplierid]">
 	   					<xsl:value-of select="servU:parseDependency($SERVOBJ, string($depname), string(@name))"/>
 	   				</xsl:for-each>
   				</xsl:for-each>
   				
   				
   				<!-- <xsl:copy-of select="$NEWLN" />  -->
   				<xsl:value-of select="servU:serviceToString($SERVOBJ, string($DELIM))"/>
   				<xsl:text>&#10;</xsl:text>
 		   </xsl:for-each>
 	   </xsl:for-each>
     </xsl:template>
</xsl:stylesheet>